#ifndef INCLUDE_H_OCTREE
#define INCLUDE_H_OCTREE
#include "voxel.h"
#include "voxel_positions.h"


struct octree
{

    voxel vox;

    octree **child;

    char valid; ///01001010 means that 1 childs are valid, 0 are invalid, from right to left. The rightmost bit corresponds to TOP_FRONT_LEFT


    octree();

    ~octree();

    void alloc_children();

    void alloc_child(char num);

    void set_child(char num, unsigned int rgb, unsigned int normal);

    void set_child_rgb(char num, unsigned int rgb);

    void set_child_normal(char num, unsigned int normal);

    void dealloc_child(char num);

    bool check_bit(char num);

    void set_bit(char num);

    void unset_bit(char num);

    octree * next_octree(char num);

};






#endif
